home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / bc_ti.zip / TI813.ASC < prev    next >
Text File  |  1992-02-25  |  1KB  |  67 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Turbo C++, Borland C++                 NUMBER  :  813
  9.   VERSION  :  All
  10.        OS  :  DOS
  11.      DATE  :  February 25, 1992                        PAGE  :  1/1
  12.  
  13.     TITLE  :  Dealing with Stack Overflow Problems
  14.  
  15.  
  16.  
  17.  
  18.   Symptoms of stack overflow are numerous.  They include program
  19.   crashing, returning to wrong address, local/global variables
  20.   getting corrupted, and so on.  The default size for the stack is
  21.   4096 bytes, or 4K.  To increase the size of the stack, the
  22.   _stklen variable is used.
  23.  
  24.   Here's how to make the assignment:
  25.  
  26.       extern unsigned _stklen = xxxxx;
  27.  
  28.   where xxxx is a number between 256 - 65535 bytes.
  29.  
  30.   The variable must be declared in the global memory location in
  31.   the program, and you must include dos.h.  You will get a
  32.   duplicate symbol declaration warning from the linker, which you
  33.   may ignore.
  34.  
  35.   Note:  The linker map will still report the stack as being 4K,
  36.          even though you changed it's size.  The helpme!.doc also
  37.          describes how to increase the stack length.
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.